#ifndef GAMEOBJECT_H
#define GAMEOBJECT_H
#include <d3d9.h>
#include <d3dx9.h>
#pragma warning( disable : 4996 ) // disable deprecated warning 
#pragma warning( disable : 4995 ) // disable deprecated warning 
#include <strsafe.h>
#pragma warning( default : 4996 )
#pragma comment (lib,"d3d9.lib")
#pragma comment (lib,"d3dx9.lib")
#include <vector>
#include "Vec2.h"

// A structure for our custom vertex type
struct CUSTOMVERTEX
{
	FLOAT x, y, z, rhw; // The transformed position for the vertex
	FLOAT tu, tv;		// The texture coordinates
};
// Our custom FVF, which describes our custom vertex structure
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW|D3DFVF_TEX1)

class GameObject 
{
public:
	GameObject(){};
	virtual HRESULT Load();		
	virtual void Unload();
	virtual HRESULT Update();
	virtual void Draw();
	bool Collision(RECT rect);
	Vec2f GetPos();
	void SetPos(Vec2f p);
	Vec2f GetVel();
	void SetVel(Vec2f p);
	Vec2f GetAcc();
	void SetAcc(Vec2f p);
	Vec2f GetSize();
	void SetSize(Vec2f s);
	void SetVB(LPDIRECT3DVERTEXBUFFER9 t);
	RECT GetVolume();
	LPDIRECT3DTEXTURE9* GetTexture() {return &m_Texture;}
protected:
	Vec2f m_Pos;
	Vec2f m_Vel;
	Vec2f m_Acc;
	Vec2f m_Size;
	RECT m_volume;
	LPDIRECT3DVERTEXBUFFER9 m_pVB;
	LPDIRECT3DTEXTURE9 m_Texture;
};

typedef std::vector<GameObject*> GameObjects;

#endif